﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace PP.Models
{
    public class Patient
    {
        [Required]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Display(Name = "Middle Name")]
        public string MiddleName { get; set; }

        [Required]
        [Display(Name = "Last Name")]
        public string LastName { get; set; }

        [Required]
        [Display(Name = "Email")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [Display(Name = "Mailing Address")]
        public string MailingAddress { get; set; }

        [Display(Name = "City")]
        public string City { get; set; }

        [Display(Name = "State")]
        public string State { get; set; }

        [Display(Name = "Zip")]
        public string Zip { get; set; }

        [Display(Name = "Country")]
        public string Country { get; set; }

        [Required]
        [Display(Name = "Phone Number")]
        [DataType(DataType.PhoneNumber)]
        public string PhoneNumber { get; set; }

        [Display(Name = "Mobile Number")]
        [DataType(DataType.PhoneNumber)]
        public string MobileNumber { get; set; }

        [Display(Name = "Brief Description of Your Request")]
        [DataType(DataType.MultilineText)]
        public string Comments { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            AddString(sb, "First Name", FirstName);
            AddString(sb,"Middle Name", MiddleName); 
            AddString(sb,"Last Name", LastName); 
            AddString(sb,"Email", Email); 
            AddString(sb,"Street Address", MailingAddress); 
            AddString(sb,"City", City); 
            AddString(sb,"State", State); 
            AddString(sb,"Zip", Zip); 
            AddString(sb,"Country", Country); 
            AddString(sb,"Phone Number", PhoneNumber); 
            AddString(sb,"Mobile Number", MobileNumber); 
            AddString(sb,"Comments", Comments); 

           return sb.ToString();
        }

        private void AddString(StringBuilder sb,string label, string value)
        {
            sb.AppendFormat("{0}: {1}", label, value); sb.AppendLine();
        }
    }
}